package com.training.web.controller.system;

import com.training.common.annotation.Log;
import com.training.common.core.domain.AjaxResult;
import com.training.common.enums.BusinessType;
import com.training.common.utils.poi.ExcelUtil;
import com.training.content.domain.TrainInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.training.common.config.TrainingConfig;
import com.training.common.utils.StringUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 首页
 *
 * @author training
 */
@RestController
public class SysIndexController
{
    /** 系统基础配置 */
    @Autowired
    private TrainingConfig trainingConfig;

    /**
     * 访问首页，提示语
     */
    @RequestMapping("/")
    public String index()
    {
        return StringUtils.format("欢迎使用{}后台管理框架，当前版本：v{}，请通过前端地址访问。", trainingConfig.getName(), trainingConfig.getVersion());
    }

    /**
     * 查询版本号及产品简介
     */
    @GetMapping("/describe")
    public AjaxResult export()
    {
        Map<String,String> desc = new HashMap<>();
        desc.put("version",trainingConfig.getVersion());
        desc.put("describe",trainingConfig.getProductDescrib());
        return AjaxResult.success(desc);
    }
}
